#pragma once

#include "ProjectItem.hpp"




namespace Engine
{
	namespace Edit
	{
		class Script
			: public ProjectItem
		{
		public:

			SHARED(Script);

		protected:

			Script(QString name);
			Script(ProjectItem::weak_ptr parent, QString name);

		public:

			MAKE_SHARED1(Script, QString);
			MAKE_SHARED2(Script, ProjectItem::weak_ptr, QString);



			/**
			 * @returns the type of item
			 */
			virtual Type type() const;

			/**
			 * @returns the content of the script
			 */
			QString content() const;

			/**
			 * Stores the given content in the script.
			 */
			void setContent(QString content);



			/**
			 * Loads the project from the given stream.
			 */
			virtual void load(AbstractDomInputStream& stream);

			/**
			 * Saves this item to the given stream.
			 */
			virtual void save(AbstractDomOutputStream& stream) const;

		private:

			QString   m_content;
		};
		///////////////////////////////////////////////////////////////////////////////////////////

		Q_DECLARE_METATYPE(Script::ptr);
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
